package com.anhry.app.safety.manage.oa.struts.action;

import java.util.List;

import org.apache.log4j.Logger;
import org.springframework.context.annotation.Scope;
import org.springframework.stereotype.Controller;

import com.anhry.app.safety.manage.oa.bean.TbOaMailUser;
import com.anhry.app.safety.manage.oa.bean.TbOaNoticeUser;
import com.anhry.app.safety.manage.oa.struts.base.OABaseAction;
import com.anhry.app.safety.manage.system.bean.TbUser;
import com.anhry.app.safety.util.Loggers;
import com.anhry.app.safety.util.Util;

/**
 * 
 * @author chen
 * @date 2012-8-16
 */

@Controller
@Scope("prototype")
@SuppressWarnings("unchecked")
public class OAWelcomeAction extends OABaseAction {

	private static final long serialVersionUID = 1L;

	private static Logger logger = Logger.getLogger(OAWelcomeAction.class);

	private List<TbOaNoticeUser> inNoitceList;// 已收通知通告列表
	 
	private List<TbOaMailUser> inMailList;// 收件箱列表
	
	private int mailSize;
	
	private int noticeSize;
	/**
	 * 协同办公首页面
	 * @return
	 */
	public String oaIndex(){
		try {
			TbUser user = (TbUser) this.contextPvd
			.getSessionAttr(Util.SESSION_ADMINUSER);
			noticeSize  = this.noticeService.getNotReadNoticeSize(user);
			this.setInNoitceList(this.noticeService.loadInNoticeList(user,"0",5));
			
			mailSize= this.mailService.loadMailList("", "",
					"", user, "0", "0");
			this.setInMailList(this.mailService.loadMailList("", "", "", user, "0", "0", 0, 5));
			
			this.setResult("welcome");
			return SUCCESS;
		} catch (Exception e) {
			e.printStackTrace();
			Loggers.info("WelcomeAction类中oaIndex()方法："+e);
		}
		return ERROR;
	}

	public List<TbOaNoticeUser> getInNoitceList() {
		return inNoitceList;
	}


	public void setInNoitceList(List<TbOaNoticeUser> inNoitceList) {
		this.inNoitceList = inNoitceList;
	}

	public List<TbOaMailUser> getInMailList() {
		return inMailList;
	}

	public void setInMailList(List<TbOaMailUser> inMailList) {
		this.inMailList = inMailList;
	}

	public int getMailSize() {
		return mailSize;
	}

	public void setMailSize(int mailSize) {
		this.mailSize = mailSize;
	}

	public int getNoticeSize() {
		return noticeSize;
	}

	public void setNoticeSize(int noticeSize) {
		this.noticeSize = noticeSize;
	}

	 

	 
	 
	 


	 
	 
}
